cmake_minimum_required(VERSION 3.16)
project(test LANGUAGES CXX)

## C11 标准
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_EXTENSIONS ON) #使用gcc 提供的扩展
set(CMAKE_C_STANDARD_REQUIRED ON)

## C++17 标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

## 未设置模式 则默认使用 Release
if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE "Release")
    set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/build/Release/bin)
    set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/build/Release/lib)
else()
    set(CMAKE_BUILD_TYPE "Debug")
    set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/build/Debug/bin)
    set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/build/Debug/lib)
endif()


set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
include(${CMAKE_MODULE_PATH}/function.cmake)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_subdirectory(test)

